package leecode;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 869
 *
 * @author qingyan 2021-10-28
 */
public class Question869 {

    public boolean reorderedPowerOf2(int n) {
        char[] chars = String.valueOf(n).toCharArray();

        Arrays.sort(chars);

        for (int i = 0; i < 31; i++) {
            char[] chars1 = String.valueOf(1 << i).toCharArray();
            Arrays.sort(chars1);
            boolean equals = Arrays.equals(chars, chars1);
            if (equals) {
                return true;
            }
        }

        return false;
    }


    public static void main(String[] args) {

    }



}
